Skip to content

KAFKA-9841: Revoke duplicate connectors and tasks when zombie workers return with an outdated assignment#8453

Merged
kkonstantine merged 3 commits into
apache:trunkfrom
Lucent-Wong:trunk
Jun 11, 2020
Merged

KAFKA-9841: Revoke duplicate connectors and tasks when zombie workers return with an outdated assignment#8453
kkonstantine merged 3 commits into
apache:trunkfrom
Lucent-Wong:trunk

Conversation

@Lucent-Wong

@Lucent-Wong Lucent-Wong commented Apr 9, 2020

Copy link
Copy Markdown
Contributor

With Incremental Cooperative Rebalancing, if a worker returns after it's been out of the group for sometime (essentially as a zombie worker) and hasn't voluntarily revoked its own connectors and tasks in the meantime, there's the possibility that these assignments have been distributed to other workers and redundant connectors and tasks might be running now in the Connect cluster.

This PR complements previous fixes such as KAFKA-9184, KAFKA-9849 and KAFKA-9851 providing a last line of defense against zombie tasks: if at any rebalance round the leader worker detects that there are duplicate assignments in the group, it revokes them completely and resolves duplication with a correct assignment in the rebalancing round that will follow task revocation.

@Lucent-Wong
Lucent-Wong marked this pull request as ready for review April 9, 2020 07:37
@Lucent-Wong
Lucent-Wong marked this pull request as draft April 9, 2020 08:01
@Lucent-Wong
Lucent-Wong marked this pull request as ready for review April 9, 2020 08:30
@kkonstantine
kkonstantine self-requested a review April 10, 2020 00:04
@kkonstantine

Copy link
Copy Markdown
Contributor

ok to test

@Lucent-Wong

Lucent-Wong commented Jun 9, 2020

Copy link
Copy Markdown
Contributor Author

Looks like the build failure is not related with my changes.

Task :streams:test-utils:integrationTest

Task :streams:upgrade-system-tests-0100:integrationTest

Task :streams:upgrade-system-tests-0101:integrationTest

Task :streams:upgrade-system-tests-0102:integrationTest

Task :streams:upgrade-system-tests-0110:integrationTest

Task :streams:upgrade-system-tests-10:integrationTest

Task :streams:upgrade-system-tests-11:integrationTest

Task :streams:upgrade-system-tests-20:integrationTest

Task :streams:upgrade-system-tests-21:integrationTest

Task :streams:upgrade-system-tests-22:integrationTest

Task :streams:upgrade-system-tests-23:integrationTest

Task :streams:upgrade-system-tests-24:integrationTest

Task :streams:upgrade-system-tests-25:integrationTest

FAILURE: Build failed with an exception.

  • What went wrong:

Execution failed for task ':streams:unitTest'.

@Lucent-Wong

Copy link
Copy Markdown
Contributor Author

retest this please

@kkonstantine kkonstantine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @Lucent-Wong
Looks good overall. Do you mind rebasing on top of the latest trunk to get the most recent changes in the assignor and its tests?

… generation assignment

Detect duplicated connectors/tasks in IncrementalCooperativeAssignor then revoke all of them to trigger next round reassignment.
@kkonstantine

Copy link
Copy Markdown
Contributor

retest this please

@kkonstantine

Copy link
Copy Markdown
Contributor

ok to test

@kkonstantine kkonstantine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @Lucent-Wong !

LGTM

@kkonstantine kkonstantine changed the title KAFKA-9841: Connector and Task duplicated when a worker join with old… KAFKA-9841: Revoke duplicate connectors and tasks when zombie workers return with an outdated assignment Jun 11, 2020
@kkonstantine
kkonstantine merged commit 6abb913 into apache:trunk Jun 11, 2020
kkonstantine pushed a commit that referenced this pull request Jun 11, 2020
… return with an outdated assignment (#8453)

With Incremental Cooperative Rebalancing, if a worker returns after it's been out of the group for sometime (essentially as a zombie worker) and hasn't voluntarily revoked its own connectors and tasks in the meantime, there's the possibility that these assignments have been distributed to other workers and redundant connectors and tasks might be running now in the Connect cluster. 

This PR complements previous fixes such as KAFKA-9184, KAFKA-9849 and KAFKA-9851 providing a last line of defense against zombie tasks: if at any rebalance round the leader worker detects that there are duplicate assignments in the group, it revokes them completely and resolves duplication with a correct assignment in the rebalancing round that will follow task revocation. 

Author: Wang <ywang50@ebay.com>

Reviewer: Konstantine Karantasis <konstantine@confluent.io>
kkonstantine pushed a commit that referenced this pull request Jun 11, 2020
… return with an outdated assignment (#8453)

With Incremental Cooperative Rebalancing, if a worker returns after it's been out of the group for sometime (essentially as a zombie worker) and hasn't voluntarily revoked its own connectors and tasks in the meantime, there's the possibility that these assignments have been distributed to other workers and redundant connectors and tasks might be running now in the Connect cluster. 

This PR complements previous fixes such as KAFKA-9184, KAFKA-9849 and KAFKA-9851 providing a last line of defense against zombie tasks: if at any rebalance round the leader worker detects that there are duplicate assignments in the group, it revokes them completely and resolves duplication with a correct assignment in the rebalancing round that will follow task revocation. 

Author: Wang <ywang50@ebay.com>

Reviewer: Konstantine Karantasis <konstantine@confluent.io>
kkonstantine pushed a commit that referenced this pull request Jun 11, 2020
… return with an outdated assignment (#8453)

With Incremental Cooperative Rebalancing, if a worker returns after it's been out of the group for sometime (essentially as a zombie worker) and hasn't voluntarily revoked its own connectors and tasks in the meantime, there's the possibility that these assignments have been distributed to other workers and redundant connectors and tasks might be running now in the Connect cluster.

This PR complements previous fixes such as KAFKA-9184, KAFKA-9849 and KAFKA-9851 providing a last line of defense against zombie tasks: if at any rebalance round the leader worker detects that there are duplicate assignments in the group, it revokes them completely and resolves duplication with a correct assignment in the rebalancing round that will follow task revocation.

Author: Wang <ywang50@ebay.com>

Reviewer: Konstantine Karantasis <konstantine@confluent.io>
kkonstantine pushed a commit that referenced this pull request Jun 11, 2020
… return with an outdated assignment (#8453)

With Incremental Cooperative Rebalancing, if a worker returns after it's been out of the group for sometime (essentially as a zombie worker) and hasn't voluntarily revoked its own connectors and tasks in the meantime, there's the possibility that these assignments have been distributed to other workers and redundant connectors and tasks might be running now in the Connect cluster. 

This PR complements previous fixes such as KAFKA-9184, KAFKA-9849 and KAFKA-9851 providing a last line of defense against zombie tasks: if at any rebalance round the leader worker detects that there are duplicate assignments in the group, it revokes them completely and resolves duplication with a correct assignment in the rebalancing round that will follow task revocation. 

Author: Wang <ywang50@ebay.com>

Reviewer: Konstantine Karantasis <konstantine@confluent.io>
Kvicii pushed a commit to Kvicii/kafka that referenced this pull request Jun 13, 2020
* 'trunk' of github.com:apache/kafka: (42 commits)
  HOTFIX: Fix compile error in TopicAdminTest (apache#8866)
  KAFKA-10144: clean up corrupted standby tasks before attempting a commit (apache#8849)
  KAFKA-10157: Fix broken tests due to InterruptedException from FinalizedFeatureChangeListener (apache#8857)
  KAFKA-9432: automated protocol for DescribeConfigs (apache#8312)
  KAFKA-10049: Fixed FKJ bug where wrapped serdes are set incorrectly when using default StreamsConfig serdes (apache#8764)
  KAFKA-10027: Implement read path for feature versioning system (KIP-584) (apache#8680)
  KAFKA-10085: correctly compute lag for optimized source changelogs (apache#8787)
  KAFKA-10086: Integration test for ensuring warmups are effective (apache#8818)
  KAFKA-9374: Make connector interactions asynchronous (apache#8069)
  MINOR: reduce sizeInBytes for percentiles metrics (apache#8835)
  KAFKA-10115: Incorporate errors.tolerance with the Errant Record Reporter (apache#8829)
  KAFKA-9216: Enforce that Connect’s internal topics use `compact` cleanup policy (apache#8828)
  KAFKA-9845: Warn users about using config providers with plugin.path property (apache#8455)
  KAFKA-7833: Add missing test (apache#8847)
  KAFKA-9066: Retain metrics for failed tasks (apache#8502)
  KAFKA-9841: Revoke duplicate connectors and tasks when zombie workers return with an outdated assignment (apache#8453)
  KAFKA-9985: Sink connector may exhaust broker when writing in DLQ (apache#8663)
  KAFKA-9441: remove prepareClose() to simplify task management (apache#8833)
  KAFKA-7833: Add Global/StateStore name conflict check (apache#8825)
  KAFKA-9969: Exclude ConnectorClientConfigRequest from class loading isolation (apache#8630)
  ...
@vutkin

vutkin commented Jul 17, 2020

Copy link
Copy Markdown

Hi guys, will fix be back-ported to older versions of kafka?

@kkonstantine

Copy link
Copy Markdown
Contributor

Hi @vutkin
I replied on the jira ticket too: https://issues.apache.org/jira/browse/KAFKA-9841

This fix has already been backported to all the applicable release branches.

ijuma added a commit to ijuma/kafka that referenced this pull request Nov 17, 2020
…t-for-generated-requests

* apache-github/trunk: (248 commits)
  KAFKA-10049: Fixed FKJ bug where wrapped serdes are set incorrectly when using default StreamsConfig serdes (apache#8764)
  KAFKA-10027: Implement read path for feature versioning system (KIP-584) (apache#8680)
  KAFKA-10085: correctly compute lag for optimized source changelogs (apache#8787)
  KAFKA-10086: Integration test for ensuring warmups are effective (apache#8818)
  KAFKA-9374: Make connector interactions asynchronous (apache#8069)
  MINOR: reduce sizeInBytes for percentiles metrics (apache#8835)
  KAFKA-10115: Incorporate errors.tolerance with the Errant Record Reporter (apache#8829)
  KAFKA-9216: Enforce that Connect’s internal topics use `compact` cleanup policy (apache#8828)
  KAFKA-9845: Warn users about using config providers with plugin.path property (apache#8455)
  KAFKA-7833: Add missing test (apache#8847)
  KAFKA-9066: Retain metrics for failed tasks (apache#8502)
  KAFKA-9841: Revoke duplicate connectors and tasks when zombie workers return with an outdated assignment (apache#8453)
  KAFKA-9985: Sink connector may exhaust broker when writing in DLQ (apache#8663)
  KAFKA-9441: remove prepareClose() to simplify task management (apache#8833)
  KAFKA-7833: Add Global/StateStore name conflict check (apache#8825)
  KAFKA-9969: Exclude ConnectorClientConfigRequest from class loading isolation (apache#8630)
  KAFKA-9991: Fix flaky unit tests (apache#8843)
  KAFKA-10014; Always try to close all channels in Selector#close (apache#8685)
  KAFKA-10079: improve thread-level stickiness (apache#8775)
  MINOR: Print all removed dynamic members during join complete (apache#8816)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants